using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using BA.DAL;
using Microsoft.VisualBasic;

namespace BlazeApps.Library.Subscriptions
{
    public class SubscriptionsList : Base
    {
        private BA.DAL.DBUtility DAL = new BA.DAL.DBUtility();
        private Procedures Procs = new Procedures();

        public DataTable GetPageSubscriptions(Guid ItemID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@ItemID", ItemID);

            return DAL.GetDataTable(Procs.ListSubscriptions.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }

        public DataTable GetPageSubscriptionsByUser(Guid UserID)
        {
            DAL.CreateDBObjects(ConnectionString, Provider);

            DAL.AddParameter("@UserID", UserID);

            return DAL.GetDataTable(Procs.ListSubscriptionsByUserID.ToString().Trim(), System.Data.CommandType.Text, System.Data.ConnectionState.Open);
        }
    }
}
